<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
    <meta charset="UTF-8">
<<<<<<< HEAD
    <title>老师信息</title>
=======
    <title>查看老师</title>
>>>>>>> 2fdbdee6364823e128f24f0caae133bfd0cb2743
    <style>
        #container {
            width: 80%;
        }
        .teacher {
<<<<<<< HEAD
            width: 100%;
            margin: 0 auto;
            padding: 10px 0;
            border-bottom: 1px dashed gray;
            overflow: auto;
=======
            width: 600px;
            height: 150px;
            margin: 0 auto;
            padding: 10px 0;
            border-bottom: 1px dashed gray;
>>>>>>> 2fdbdee6364823e128f24f0caae133bfd0cb2743
        }
        .teacher div {
            float: left;
        }
        .photo {
<<<<<<< HEAD
            height: 140px;
            border-radius: 75px;
            overflow: hidden;
            margin-left: 20px;
        }
        .info {
            width: 75%;
            margin-left: 30px;
        }
        .info div {
            clear: both;
            margin: 5px 10px;
=======
            width: 25%;
            height: 150px;
        }
        .info {
            width: 70%;
            height: 150px;
            margin-left: 10px;
        }
        .info div {
            clear: both;
            margin: 2px 10px;
        }
        .info>.intro {
            height: 60%;
            width: 85%;
>>>>>>> 2fdbdee6364823e128f24f0caae133bfd0cb2743
        }
        .info span {
            margin-right: 25px;
        }
<<<<<<< HEAD
        .info a {
            text-decoration: none;
            color: blue;
=======
        img{
        width:100%
        height:150px

>>>>>>> 2fdbdee6364823e128f24f0caae133bfd0cb2743
        }
    </style>
</head>
<body>
<<<<<<< HEAD
    <h1>{{ subject.name }}的老师信息</h1>
=======
    <h1>{{ subject.name }}老师信息</h1>
>>>>>>> 2fdbdee6364823e128f24f0caae133bfd0cb2743
    <hr>
    <div id="container">
        {% for teacher in teachers %}
        <div class="teacher">
            <div class="photo">
<<<<<<< HEAD
                <img src="{% static teacher.photo %}" height="140" alt="">
            </div>
            <div class="info">
                <div>
                    <span><strong>姓名：{{ teacher.name }}</strong></span>
                    <span>性别：{{ teacher.gender | yesno:'男,女' }}</span>
                    <span>出生日期：{{ teacher.birth }}</span>
                </div>
                <div class="intro">{{ teacher.intro }}</div>
                <div class="comment">
                    <a href="/vote/praise/?tno={{ teacher.no }}">好评</a>（<span>{{ teacher.good_count }}</span>）
                    <a href="/vote/criticize/?tno={{ teacher.no }}">差评</a>（<span>{{ teacher.bad_count }}</span>）
=======
<!--                <img src="{{ teacher.photo }}" alt="" height="150px" width="100%">-->
                <img src="{% static teacher.photo %}" alt="" height="150px" width="100%">
            </div>
            <div class="info">
                <div>
                    <span><strong>{{ teacher.name }}</strong></span>
                    <span>{{ teacher.birth }}</span>
                    <span>{{ teacher.tel }}</span>
                </div>
                <div class="intro">{{ teacher.intro }}</div>
                <div>
                    <a href="">好评（{{ teacher.good_count }}）</a>
                    <a href="">差评（{{ teacher.bad_count }}）</a>
>>>>>>> 2fdbdee6364823e128f24f0caae133bfd0cb2743
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
<<<<<<< HEAD
    <script src={{"https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"}}></script>
    <script>
        $(() =>{
            $('.comment > a').on('click', (evt) => {
                evt.preventDefault()
                let a = $(evt.target)
                $.getJSON(a.attr('href'),(json) => {
                    if(json.code == 200){
                        let span = a.next()
                        span.text(parseInt(span.text()) +1)
                    }else if(json.code == 401){
                        location.href = '/vote/login/?backurl=' +
                        location.pathname + location.search
                    }else{
                        alert(json.message)
                    }
                })
            })
        })
    </script>
=======
>>>>>>> 2fdbdee6364823e128f24f0caae133bfd0cb2743
</body>
</html>